package com.example.booksystem.repository;



import com.example.booksystem.model.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BookRepository extends JpaRepository<Book, Long> {

    //通过名字来查找学生数据
    @Query("select b from Book b where b.bookName like %:name%")
    List<Book> findByBookName(@Param("name") String name);


}
